﻿
Partial Class webservices_usercontrols_UCBaycity
    Inherits System.Web.UI.UserControl

    Public Sub Display(p As CProduct)
        lnkText.Text = p.ProductName
        If Not p.Files.HasMp3 Then Exit Sub
        lnkText.NavigateUrl = CConfig.DropboxUrl(p.Files.FirstMp3.FileName)
        If p.Files.FirstMp3.FileSize > 0 Then
            lnkText.Text = String.Concat(p.ProductName, " (", CUtilities.FileSize(p.Files.FirstMp3.FileSize), ")")
        End If

        lnkImg.NavigateUrl = CConfig.DropboxUrl(p.Files.FirstMp3.FileName)

        lnkDate.Text = String.Concat(p.DateString, " ~ ", p.SpeakerNames)
        lnkDate.NavigateUrl = CConfig.WebsiteUrl_Product(p)

        lnkDeaf.Visible = p.HasTranscript
        lnkDeaf.NavigateUrl = CConfig.WebsiteUrl_Product(p) & "#transcript"

        lnkNotes.Visible = p.Files.HasHtm OrElse p.Files.HasPdfOrWord
        lnkNotes.NavigateUrl = CConfig.WebsiteUrl_Product(p) & "#notes"

        lnkVideo.Visible = p.HasVideos
        lnkVideo.NavigateUrl = CConfig.WebsiteUrl_Product(p) & "#video"

        lnkPhotos.Visible = p.DuncanPhotos.Count > 0
        lnkPhotos.NavigateUrl = CConfig.WebsiteUrl_Product(p) & "#photos"

        lnkColeen.Visible = (p.ProductImageScribeId = eScribe.Colleen)
        lnkColeen.NavigateUrl = CConfig.WebsiteUrl_Product(p)
    End Sub

End Class
